package com.gmq.chapter01.suspend;

/**
 * Created by gmq on 2017/08/10.
 *
 * @version 1.0
 * @since 2017/08/10 14:30
 */
public class SynchronizedObject {

    synchronized public void printString() {
        System.out.println("begin");
        if (Thread.currentThread().getName().equals("a")) {
            System.out.println("a 线程永远suspend了！ ");
            Thread.currentThread().suspend();
        }
        System.out.println("end");
    }
}
